/* 
 * Cognitive Profile Copyright (C) 2007 Lois Breur Krause
 */

package cpi;

/**
 * 
 * 
 * @author jdp
 */
public abstract class Group {

    public enum Type {

        ST,
        SF,
        NT,
        NF
    }

    public final static Type TypeOf(java.lang.String value){
        if (null == value)
            return null;
        else {
            if (2 < value.length())
                value = value.trim();
            if (2 == value.length()){
                switch (value.charAt(0)){
                case 'S':
                case 's':
                    switch(value.charAt(1)){
                    case 'F':
                    case 'f':
                        return Type.SF;
                    case 'T':
                    case 't':
                        return Type.ST;
                    default:
                        break;
                    }
                    break;
                case 'N':
                case 'n':
                    switch(value.charAt(1)){
                    case 'F':
                    case 'f':
                        return Type.NF;
                    case 'T':
                    case 't':
                        return Type.NT;
                    default:
                        break;
                    }
                    break;
                default:
                    break;
                }
            }
            throw new java.lang.IllegalArgumentException(value);   
        }
    }

}
